﻿using System;
using System.Collections;
using System.Data;
using System.Web;
using System.Web.Services;
using System.Web.Services.Protocols;
using NLBS.Web.HttpHandlers;

namespace NLBS.Blog.Services
{
    
    public class Utility : AjaxHandler
    {

        public string GetNewMessage()
        {
           string msg= NLBS.Net.WebResourceRequest.CallUrlRequest("http://www.clingingboy.cn/Update/NewMsg.htm");
           return msg;
        }

        public string Update(string updateURL)
        {
            string path = HttpContext.Current.Server.MapPath("/uploads/update/");
            NLBS.Net.WebResourceRequest.Downloadfile(updateURL, path);
            int start = updateURL.LastIndexOf("/")+1;
            NLBS.Utility.AttachmentUnZip.UpZip(path + updateURL.Substring(start), HttpContext.Current.Server.MapPath("/"));
            return string.Empty;
        }
    }
}
